#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include <stdlib.h>

using namespace std;

bool check(string  n,int d)
{
	string s = n;
	
	for (int i=0;i<s.size();i++)
	{
		int x = s[i]-'0';
		if (x==d)
		{
			return true;
		}
	}
	return false;
}

int main()
{
	string  n;
	int d;
	cin >> n >> d;
	bool ret = check(n,d);
	if (ret) cout <<  "true" << endl;
	else cout <<  "false" << endl;
	return 0;	
} 
